package com.cwf.common.core.service;

import com.cwf.common.enums.ResCodeEnum;
import com.cwf.common.exception.base.MyException;
import com.cwf.common.exception.base.SQLByIdSelectException;

import java.util.List;

public class BaseService {


    public static void checkByIdGetInfoResult(Object data, String errMsg) {
        if (data == null) {
            throw new MyException(errMsg, ResCodeEnum.SELECTONE_ERR.getCode());
        }
    }


    public static <T> void checkListResult(List<T> data, String errMsg) {
        if (data.size() == 0) {
            throw new MyException(errMsg, ResCodeEnum.SELECTONE_ERR.getCode());
        }
    }


}
